<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu" data-widget="tree">
            <li class="header">菜单</li>
            <?php
                if(!empty($menuList)){
                    foreach($menuList as $val){
                        if($val['is_show'] == 0){
                            continue;
                        }
                        $class  = '';
                        if(!empty($val['child'])){
                            $class = 'treeview';
                        }
                        $showUl = '';
                        if($val['show'] == 1){
                            $class  .=' menu-open';
                            $showUl = 'style="display:block;"' ;
                    }
            ?>
                <li class="<?php echo $class;?>">
                    <a href="<?php echo $val['url'];?>">
                        <i class="fa <?php echo $val['icon_name'];?>"></i>
                        <span><?php echo $val['name'];?></span>
                        <?php
                            if(!empty($val['child'])){
                        ?>
                            <span class="pull-right-container">
                              <i class="fa fa-angle-left pull-right"></i>
                            </span>
                        <?php }?>
                    </a>
                    <ul class="treeview-menu" <?php echo $showUl;?>>
                    <?php
                        if(!empty($val['child'])){
                            //继续循环
                            foreach($val['child'] as $value){
                                if($value['is_show'] == 0){
                                    continue;
                                }
                                $class = '';
                                if(!empty($value['child'])){
                                    $class = 'treeview';
                                }
                                $showUl = '';
                                $nameClass = '';
                                if($value['checked'] == 1){
                                    $class   .=' menu-open';
                                    $showUl = 'style="display:block;"' ;
                                    $nameClass = 'style="color: white"';
                                }
                    ?>
                        <li class="<?php echo $class;?>">
                            <a href="<?php echo $value['url'];?>">
                                <i class="fa <?php echo $value['icon_name'];?>"></i>
                                <span <?php echo $nameClass;?>><?php echo $value['name'];?></span>
                                <?php
                                    if(!empty($value['child'])){
                                ?>
                                    <span class="pull-right-container">
                                      <i class="fa fa-angle-left pull-right"></i>
                                    </span>
                                <?php }?>
                            </a>
                            <?php
                                if(!empty($value['child'])){
                                    //继续循环
                                    foreach($value['child'] as $v){
                                        if($v['is_show'] == 0){
                                            continue;
                                        }
                                        $class = '';
                                        $nameClass = '';
                                        if(empty($value['child'])){
                                            $class = 'treeview';
                                            $nameClass = 'style="color: white"';
                                        }
                            ?>
                            <ul class="treeview-menu" <?php echo $showUl;?>>
                                <li>
                                    <a href="<?php echo $v['url'];?>">
                                        <i class="fa <?php echo $v['icon_name'];?>"></i>
                                        <span <?php echo $nameClass;?>> <?php echo $v['name'];?><span>
                                    </a>
                                </li>
                            </ul>
                            <?php }}?>
                        </li>
                    <?php }}?>
                    </ul>
                </li>
            <?php }}?>
        </ul>
    </section>
    <!-- /.sidebar -->
</aside>